<!--
 * @Description: 编辑按钮
 * @Version: 1.0
 * @Author: Yuanjy
 * @Date: 2020-03-13 19:56:08
 * @LastEditors: Yuanjy
 * @LastEditTime: 2020-04-21 11:44:27
 -->
<template>
  <div>
    <el-button size="mini" type="success" @click="to">编辑</el-button>
    <eForm ref="form" :sup_this="sup_this" :is-add="false"/>
  </div>
</template>
<script>
import eForm from './form'

export default {
  components: { eForm },
  props: {
    data: {
      type: Object,
      required: true
    },
    sup_this: {
      type: Object,
      required: true
    }
  },
  methods: {
    to() {
      const _this = this.$refs.form
      _this.form = {
        id: this.data.id,
        corp_name: this.data.corp_name,
        corpid: this.data.corpid,
        agentid: this.data.agentid,
        secret: this.data.secret,
        xzs_agentid: this.data.xzs_agentid,
        xzs_secret: this.data.xzs_secret,
        wechat_appid: this.data.wechat_appid,
        mini_appid: this.data.mini_appid,
        mini_secret: this.data.mini_secret,
        enabled: this.data.enabled.toString()
      }
      _this.dialog = true
    }
  }
}
</script>

<style scoped>
  div{
    display: inline-block;
    margin-right: 3px;
  }
</style>
